package com.xlabs.client;

import com.google.gwt.user.client.rpc.IsSerializable;

import java.io.Serializable;
import java.util.Date;

/**
 * TimedCommentUI class.
 */
public class CommentDTO implements Serializable, IsSerializable {
    /**
     * The text comment.
     */
    private String comment;

    /**
     * time of comment.
     */
    private double time;

    /**
     * Key in the form of encoded string.
     */
    private String encodedKey;

    /**
     * parent's reply.
     */
    private CommentDTO parent;

    /**
     * createdBy.
     */
    private String createdBy;

    /**
     * createdOn.
     */
    private Date createdOn;


    /**
     * Initializes an instance of TimedCommentUI
     *
     * @param comment comment
     * @param time    time
     */
    public CommentDTO(String comment, double time, String encodedKey) {
        this.comment = comment;
        this.time = time;
        this.encodedKey = encodedKey;
    }

    /**
     * Public constructor for GWT.
     */
    public CommentDTO() {
    }

    /**
     * Gets comment.
     *
     * @return comment.
     */
    public String getComment() {
        return comment;
    }

    /**
     * Sets Comment.
     *
     * @param comment The text comment.
     */
    public void setComment(String comment) {
        this.comment = comment;
    }

    /**
     * Gets time.
     *
     * @return time.
     */
    public double getTime() {
        return time;
    }

    /**
     * Sets time.
     *
     * @param time time of comment.
     */
    public void setTime(double time) {
        this.time = time;
    }

    /**
     * Gets encodedKey
     *
     * @return Encoded key.
     */
    public String getEncodedKey() {
        return encodedKey;
    }

    /**
     * Sets encodedKey
     *
     * @param encodedKey Encoded key
     */
    public void setEncodedKey(String encodedKey) {
        this.encodedKey = encodedKey;
    }

    /**
     * Gets parent.
     *
     * @return parent.
     */
    public CommentDTO getParent() {
        return parent;
    }

    /**
     * Sets parent.
     *
     * @param parent parent.
     */
    public void setParent(CommentDTO parent) {
        this.parent = parent;
    }

    /**
     * Gets createdBy.
     * @return createdBy.
     */
    public String getCreatedBy() {
        return createdBy;
    }

    /**
     * Sets createdBy.
     * @param createdBy createdBy.
     */
    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    /**
     * Gets createdOn.
     * @return createdOn.
     */
    public Date getCreatedOn() {
        return createdOn;
    }

    /**
     * Sets createdOn.
     * @param createdOn createdOn.
     */
    public void setCreatedOn(Date createdOn) {
        this.createdOn = createdOn;
    }
}
